<script>
    $(function(){
        $('#{{datagrid_id}}').datagrid({
            columns:[[
                    {field:'selected', checkbox:true },
                    {field:'account_num',title:'交易账户',width:110, sortable:true,
                        sorter:function(a,b){
                            return (a>b?1:-1);
                        }
                    },
                    {field:'name',title:'姓名',width:60},
                    {field:'loginname',title:'登录名',width:60},
                    {field:'ticktype',title:'彩票种类',width:40},
                    {field:'period',title:'彩票期次',width:40},
                    {field:'tradamount',title:'交易金额',width:40},
                    {field:'tradeMethod',title:'交易方式',width:40},
                    {field:'tradtime',title:'交易时间',width:60},
                    {field:'status',title:'状态',width:40},
                    //{field:'desc',title:'描述',width:90},
                   {field:'tradeid',title:'操作选项',width:40,
                        formatter:function(value,row,index){
                                     return '<a onclick="javascript:return popUpEdit(this)" href="/lottery/count_inquire/infodetail/'+value+'">详细信息</a>';
                      }
                  }
                    ]],
             toolbar:[
				{
					id:'export',
					text:'导出',
					iconCls:'icon-ok',
					handler: export_record
				}
			],
                    onLoadError: function() {
                        $.jBox.tip('没有数据或根据搜索条件查不到相关数据', 'info');
                        $("div.datagrid-body").css("height",0).find("table > tbody").empty();
                        $("div.datagrid-view").css("height",'23px');
                     }
                 });
                    $('#{{datagrid_id}}s').searchbox({
                        width:300,  
                        searcher:function(value,name){
                        var result = $('#{{datagrid_id}}').datagrid('reload', {
                                          query_key: name,
                                        query_value: value
                                     });
                                 },
                        menu:'#{{datagrid_id}}mm',  
                        prompt:'请输入搜索条件'  
                });
       });
       
   function popUpEdit(cur){
        $.jBox("get:"+ cur.href,{
            title: "详细信息",
            width: 1150,
            height: 380,
           top: '9%'
        });
        return false;
    }
   function export_record(){
	   window.location.href = '/lottery/count_inquire/saleinfo/export';
   }
</script>

<div style="padding:20px;overflow:hidden;" class="ajust_height">
     <div style="padding-bottom:20px;overflow:hidden;">
        <input id="{{datagrid_id}}s"></input>
        <div id="{{datagrid_id}}mm" style="width:120px">
            <div name="loginname" iconCls="icon-ok">登录名</div>
            <div name="account" iconCls="icon-ok">交易账户</div>
        </div>
    </div>   
    <table id="{{datagrid_id}}" url="/lottery/count_inquire/saleinfo" striped="true"
        pagination="true" iconCls="icon-save" url="" fitColumns="true" singleSelect="false"
        rownumbers="true" pageSize="15"   pageList=" [5,10,15,20,25]">
    </table>
</div>
   




